package com.itheima.service.impl;

import com.itheima.domain.Assignment;
import com.itheima.domain.User;
import com.itheima.domain.UserStudentAssignment;
import com.itheima.mapper.AssignmentMapper;
import com.itheima.mapper.UserMapper;
import com.itheima.service.AssignmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AssignmentServiceImpl implements AssignmentService {
    @Autowired
    private AssignmentMapper assignmentMapper;


    @Override
    public List<User> selectWork(Assignment assignment) {
        return assignmentMapper.selectWork(assignment);
    }

    @Override
    public boolean publishWork(Assignment assignment) {
        return assignmentMapper.publishWork(assignment) > 0;
    }

    @Override
    public List<User> selectWorkCondition(UserStudentAssignment userStudentAssignment) {
        return  assignmentMapper.selectWorkCondition(userStudentAssignment);
    }
}
